
// This file is part of the mstp-lib library, available at http://code.google.com/p/mstp-lib/ 
// Copyright (c) 2011-2014 Adrian Gostin, distributed under the GNU General Public License v3.

#ifndef MSTP_LOG_H
#define MSTP_LOG_H

#include "bridge.h"

void STP_Log (BRIDGE* bridge, int port, int tree, const char* format, ...);
void STP_FlushLog (BRIDGE* bridge);
void STP_Indent (BRIDGE* bridge);
void STP_Unindent (BRIDGE* bridge);

#define LOG(b,p,t,...)		((void) ( !(b)->loggingEnabled || (STP_Log(b,p,t,__VA_ARGS__), 0)))
#define FLUSH_LOG(b)		((void) ( !(b)->loggingEnabled || (STP_FlushLog(b), 0)))
#define LOG_INDENT(b)		((void) ( !(b)->loggingEnabled || (STP_Indent(b), 0)))
#define LOG_UNINDENT(b)		((void) ( !(b)->loggingEnabled || (STP_Unindent(b), 0)))

#endif
